#include <stdio.h>
#include <stdlib.h>

int get_maxfd(void)
{
	char buf[64] = {0};
	FILE *pf = NULL;
	pf = popen("ulimit -n", "r");
	fread(buf, sizeof(char), sizeof(buf), pf);
	pclose(pf);
	return atoi(buf);
}